/**
 * 
 */
package com.study.proxy.ext;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author Administrator
 * @date 2019年6月22日
 */
public class $Proxy0 implements OrderService {
    private MyExtInvocationHandler h;

    /**
     * 使用构造函数传递myExtInvocationHandler
     *
     * @param myExtInvocationHandler
     */
    public $Proxy0(MyExtInvocationHandler myExtInvocationHandler) {
        this.h = myExtInvocationHandler;
    }

    @Override
    public void order() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        //传递被代理对象的方法
        Method orderMethod = OrderService.class.getMethod("order", new Class[]{});
        this.h.invoke(this, orderMethod, null);
    }

}
